{-# LANGUAGE QuasiQuotes #-}

module Vote.Internal.Hello where

import Data.Aeson (genericParseJSON, genericToEncoding, genericToJSON)
import Data.OpenApi (fromAesonOptions, genericDeclareNamedSchema)
import Data.Profunctor.Product
import Opaleye
import Protolude
import Tedious.Type (tt)

[tt|
  Dog deriving Show Eq Generic
    firstName Text ("first_name", Field SqlText) DogA DogC
    secondName Text ("second_name", Maybe (Field SqlText), Field SqlText) DogA
    address Text (Maybe (Field Text), Field Text) DogA
    master Text? (FieldNullable Text) DogA DogB? -- master
    masterAge Int DogC -- age of dog's master
    age Int DogA DogB?
    hobby (Maybe Text)? (FieldNullable Text) DogC? DogB
    color Text DogB DogC
    
  Cat deriving Show Eq Generic
    name Text CatA CatC
    master Text? CatA CatB?
    age Int CatA CatB?
    hobby (Maybe Text)? CatC? CatB
    color Text CatB CatC
  |]
